#include <bits/stdc++.h>
using namespace std;
const int maxn = 500;
const int mod = 1000000007;
string str;
int n, k;
int f[maxn + 5][maxn + 5][2];
int dp(int l, int r, bool simple) {
	if (l == r)
		return 0;
	if (f[l][r][simple] != -1)
		return f[l][r][simple];
	int ans = 0;
	bool flag = true;
	for (int i = l + 1; i < r; i++)
		if (str[i] == '(' || str[i] == ')')
			flag = false;
	if (flag && (str[l] == '(' || str[l] == '?') && (str[r] == ')' || str[r] == '?') && r - l - 1 <= k)
		ans = 1;
	if ((str[l] == '(' || str[l] == '?') && (str[r] == ')' || str[r] == '?')) {
		for (int i = l + 1; i <= min(r - 2, l + k); i++) {
			if (str[i] == '(' || str[i] == ')')
				break;
			ans = (ans + dp(i + 1, r - 1, false)) % mod;
		}
		for (int i = r - 1; i >= max(l + 2, r - k); i--) {
			if (str[i] == '(' || str[i] == ')')
				break;
			ans = (ans + dp(l + 1, i - 1, false)) % mod;
		}
		if (l + 1 <= r - 1)
			ans = (ans + dp(l + 1, r - 1, false)) % mod;
	}
	if (simple == false) {
		int a[maxn + 5], sum[maxn + 5];
		sum[l - 1] = 0;
		int lasted = 0;
		for (int i = l; i < r; i++) {
			a[i] = dp(l, i, true);
			if (str[i] == '?' || str[i] == '*') {
				sum[i] = (sum[i - 1] + a[i]) % mod;
				lasted++;
			} else {
				sum[i] = 0;
				lasted = 0;
			}
			if (i - k - 1 >= l && lasted > k + 1)
				sum[i] = (sum[i] - a[i - k - 1] + mod) % mod;
//			sum[i] = 0;
//			for (int j = 0; j <= k; j++) {
//				if (str[i - j] == '(' || str[i - j] == ')')
//					break;
//				if (i - j >= l)
//					sum[i] = (sum[i] + a[i - j]) % mod;
//			}
		}
		for (int i = l + 1; i <= r; i++)
			ans = (ans + 1ll * sum[i - 1] * dp(i, r, false) % mod) % mod;
	}
	f[l][r][simple] = ans;
	return ans;
}
int main() {
	freopen("bracket.in", "r", stdin);
	freopen("bracket.out", "w", stdout);
	cin >> n >> k;
	cin >> str;
	str = " " + str;
	memset(f, -1, sizeof(f));
	cout << dp(1, n, false);
}
